package com.cike.sparkstudy.sql.scala

import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}

/**
  * 通用的save和load操作
  */
object GenericLoadSave {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local").setAppName("GenericLoadSave")
    val sc = new SparkContext(conf)
    val sqlContext = new SQLContext(sc)


    //val userDF = sqlContext.read.load("/developerCodes/test/users.parquet")

    //userDF.select("name").write.save("/developerCodes/test/namesAndFavColors.parquet")

    sqlContext.read.load("/developerCodes/test/namesAndFavColors.parquet/part-r-00000-dd78c05a-5f0c-42a9-9255-e2bb136eb42c.gz.parquet")
      .show()


  }

}
